package com.kamistoat.meimeimall.common.constant;

import java.util.concurrent.TimeUnit;

/**
 * Auth模块常量
 */
public class AuthConstant {
    /**
     * 缓存前缀-短信验证码
     */
    public static final String SMS_CODE_CACHE_PREFIX = "sms:code:register:";

    /**
     * 缓存时间-注册验证码过期时间
     */
    public static final long SMS_CODE_EXPIRE_TIME = 5L;

    /**
     * 缓存时间-验证码时间单位
     */
    public static final TimeUnit SMS_CODE_EXPIRE_UNIT = TimeUnit.MINUTES;

    /**
     * 缓存名称-登录认证信息session名
     */
    public static final String LOGINUSER_KEY = "loginUser";

    /**
     * 用户登录令牌在ThreadLocal中的名字
     */
    public static final String LOGIN_USER_THREADLOCAL_NAME = "loginSuccessTo";

    /**
     * 缓存中的用户令牌前缀
     */
    public static final String LOGIN_USER_REDIS_PREFIX = "login:user:";

    /**
     * 缓存中用户令牌的过期时间
     */
    public static final long LOGIN_USER_REDIS_EXPIRE = 2L * 24L * 60L * 60L;

    /**
     * 令牌自定义标识
     */
    public static final String JWT_AUTHENTICATION = "Authorization";

    /**
     * 令牌前缀
     */
    public static final String JWT_PREFIX = "Bearer ";

    /**
     * 令牌秘钥
     * 可任取，这里使用所有英文字母作为秘钥
     */
    public final static String JWT_SECRET = "abcdefghijklmnopqrstuvwxyz";

    public final static String JWT_USER_TOKEN = "user_token";

    public final static String JWT_USER_ID = "user_id";

    public final static String JWT_USER_NAME = "user_name";


}
